//
// Created by zhuanding on 2023/6/23.
//

#ifndef DATA_STRUCTURE_NOTES_INDEX_H
#define DATA_STRUCTURE_NOTES_INDEX_H

#define int ElemType;

typedef struct {
    ElemType *elem;   // 0号单元留空
    int TableLen;
} SSTable;

int Search_Seq(SSTable ST, ElemType key);


int Search_Seq(SSTable ST, ElemType key) {
    ST.elem[0] = key;  // 哨兵
    for(int i=ST.TableLen; ST.elem[i]!=key, i--);  // 从后往前找
    return i;   // 若查找成功，返回位序；若查找失败，返回0
}// Search_Seq


#endif //DATA_STRUCTURE_NOTES_INDEX_H
